<HTML><HEAD><TITLE>global ++SpecList</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Obsolete</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>global ++SpecList</H1>
Declares the procedure(s) and other modular items specified by SpecList
to be global.

<DL>
<DT><EM>SpecList</EM></DT>
<DD>Sequence of modular item specifications.
</DD>
</DL>
<H3>This built-in predicate is obsolete!</H3>
<H2>Description</H2>
   This predicate is obsolete - global visibility is being deprecated.
   For procedures, use export declarations instead. For other global
   items, replace them by local ones and, if necessary, provide exported
   access procedures to manipulate them.
<P>
   This predicate was used to declare the visibility of procedures
   and other names as global. SpecList is a comma-separated list
   of expressions of the following form:
<DL>
<DT><STRONG> Name/Arity</STRONG><DD>
        procedure specification (since global procedures are no longer
	supported, this is now the same as exporting)

<DT><STRONG> variable(Name)</STRONG><DD>
	non-logical variable declaration

<DT><STRONG> reference(Name)</STRONG><DD>
	reference declaration

<DT><STRONG> array(Name)</STRONG><DD>
	untyped non-logical array declaration

<DT><STRONG> array(Name,Type)</STRONG><DD>
	typed non-logical array declaration

<DT><STRONG> record(Name)</STRONG><DD>
	record key declaration

<DT><STRONG> struct(Prototype)</STRONG><DD>
	structure declaration

<DT><STRONG> op(Prec,Assoc,Name)</STRONG><DD>
	operator declaration

<DT><STRONG>macro(Functor,Transformation,Options)</STRONG><DD>
	macro (input transformation) declaration

<DT><STRONG>portray(Functor,Transformation,Options)</STRONG><DD>
	portray (output transformation) declaration
</DL>
    For backward compatibility, global declarations of variables,
    references, arrays, records, structures, operators and macros
    still work. However, global procedure declarations now have the
    same effect as an export declaration and generate a warning message.

<H3>Modes and Determinism</H3><UL>
<LI>global(++) is det
</UL>
<H3>Modules</H3>
This predicate is sensitive to its module context (tool predicate, see @/2).
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>SpecList is not instantiated.
<DT><EM>(5) type error </EM>
<DD>SpecList is instantiated, but not to a valid global specification
<DT><EM>(94) trying to redefine an existing imported procedure </EM>
<DD>SpecList is already imported.
</DL>
<H2>Examples</H2>
<PRE>
Success:

  [eclipse]: [user].
   :- global p/1.
   p(eclipse).
   user compiled 40 bytes in 0.00 seconds
  yes.
  [eclipse]: module(m).
  [m]: [user].
   :- local p/1. % can be omitted here since default is local.
   p(m).
   user compiled 40 bytes in 0.00 seconds
  yes.
  [m]: p(X).
  X = m
  yes.
  [m]: abolish(p/1).
  yes. % local predicate is abolished, global is visible again
  [m]: p(X).
  X = eclipse
  yes.

Error:

  global(Q).                        (Error 4).
  global("Pred").                   (Error 5).

  [eclipse]: [user].
   % :- tool(t/0) here would prevent error 62 in global(t/0) below
   p :- t.
   user   compiled 32 bytes in 0.02 seconds
  yes.
  [eclipse]: module(m).
  [m]: [user].
   :- tool(t/0, writeln/1).
   :- global(t/0).                  (Error 62).

  global(p/0), global(p/0).         (Error 89). (warning)
  (import p/0 from m), global(p/0). (Error 94).
  global(true/0).                   (Error 95).



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/modules/export-1.html">export / 1</A>, <A HREF="../../kernel/modules/import-1.html">import / 1</A>, <A HREF="../../kernel/modules/local-1.html">local / 1</A>
</BODY></HTML>
